﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleMaintenance.aspx.cs" Inherits="MeetingMinutesManager.Maintenance.RoleMaintenance" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Role Maintenance</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 102px;
            text-align: right;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table class="style1">
            <tr>
                <td class="style2">
                    Role:</td>
                <td>
                    <asp:TextBox ID="txtRole" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Rank:</td>
                <td>
                    <asp:DropDownList ID="ddlRanks" runat="server" Width="200px">
                        <asp:ListItem Value="500">SBU Director</asp:ListItem>
                        <asp:ListItem Value="300">ODC Manager</asp:ListItem>
                        <asp:ListItem Value="200">Delivery Manager</asp:ListItem>
                        <asp:ListItem Value="100">Architect</asp:ListItem>
                        <asp:ListItem Value="100">Project Manager</asp:ListItem>
                        <asp:ListItem Value="50">Project Lead</asp:ListItem>
                        <asp:ListItem Value="30">Senior Engieer</asp:ListItem>
                        <asp:ListItem Value="10">Engineer</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add Role" />
                </td>
                <td>
                    <asp:Button ID="btnClean" runat="server" onclick="btnClean_Click" 
                        Text="Clean" />
                </td>
            </tr>
        </table>
    
    </div>
    <asp:GridView ID="grvRoles" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataKeyNames="id" DataSourceID="SqlDataSourceRoles" ForeColor="#333333" 
        GridLines="None">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="role" HeaderText="role" SortExpression="role" />
            <asp:BoundField DataField="srtseq" HeaderText="srtseq" 
                SortExpression="srtseq" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceRoles" runat="server" 
        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
        DeleteCommand="DELETE FROM [role] WHERE [id] = ?" 
        InsertCommand="INSERT INTO [role] ([role], [srtseq], [id]) VALUES (?, ?, ?)" 
        ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
        SelectCommand="SELECT [role], [srtseq], [id] FROM [role]" 
        UpdateCommand="UPDATE [role] SET [role] = ?, [srtseq] = ? WHERE [id] = ?">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="role" Type="String" />
            <asp:Parameter Name="srtseq" Type="Int32" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="role" Type="String" />
            <asp:Parameter Name="srtseq" Type="Int32" />
            <asp:Parameter Name="id" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
